<?php
namespace App\Console\Commands;


use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;

class Test1 extends Command {

    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'mail:ceshi';

    protected $description = '测试';

    public function __construct()
    {
        parent::__construct();
    }

    public function handle()
    {
        $org_id = $this->option('org_id');
        $this->info(date('Y-m-d', time()) . ":");
        echo "Command sleep 20's, ", date("Y-m-d H:i:s".$org_id);
        sleep(20);
        return 0;
    }

    /**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return [
            ['org_id', null, InputOption::VALUE_OPTIONAL, 'org_id', null],
            ['date', null, InputOption::VALUE_OPTIONAL, 'date', date('Y-m')],
        ];
    }

}
